import * as echarts from 'echarts';
type EChartsOption = echarts.EChartsOption;

export default function barOption4(myChart: echarts.ECharts) {
    return {
        title: {
            text: 'bar Chart4',
            subtext: 'Fake Data',
            left: 'center'
        },
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', "web", "java"]
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        yAxis: {
            type: 'value'
        },
        series: [
            //设置某个柱子的颜色
            {
                data: [150, 200, 224, 218, 135, 147, 260, 189, 216],
                type: 'bar',
                barWidth: "20px",
                itemStyle: {
                    //设置圆角
                    barBorderRadius: [15, 15, 0, 0],
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        {
                            offset: 0,
                            color: "#02a0ba",
                        },
                        // 百分之100状态之下的颜色值
                        {
                            offset: 1,
                            color: "#f9c01a",
                        },
                    ])
                },
                markPoint: {
                    data: [
                        { type: 'max', name: 'Max' },
                        { type: 'min', name: 'Min' }
                    ],
                    itemStyle:{
                        color:"#6475d4"
                    },
                    label:{
                        color:"white"
                    }
                },
                markLine: {
                    data: [{ type: 'average', name: 'Avg' }]
                }
            }
        ]
    } as EChartsOption;
}

